package com.itany.corejava.day18;

//获得Class对象
public class TestClass1 {


    public static void main(String[] args) throws ClassNotFoundException {

        //通过对象获得Class对象
        Person p=new Person();
        Class c1=p.getClass();

        //通过类名获得Class对象
        Class c2=Person.class;

        //通过字符串获得Class对象
        Class c3=Class.forName("com.itany.corejava.day18.Person");


        System.out.println("c1 = " + c1);
        System.out.println("c2 = " + c2);
        System.out.println("c3 = " + c3);

        System.out.println(c1==c2);
        System.out.println(c1==c3);
        System.out.println(c2==c3);

        System.out.println(int.class);

    }

}
